package co.msk8.shared;




public class OperationContainer {

	private static final String CERO = "0";
	private String firstOperator;
	private String secondOperator;
	private Operation operation;
	private String result;
	
	
	public OperationContainer() {
		
		firstOperator = CERO;
	}
	
	public String getFirstOperator() {
		return firstOperator;
	}
	
	public void setFirstOperator(String a) {

		this.firstOperator = a;
	}
	
	public String getSecondOperator() {
		return secondOperator;
	}

	public void setSecondOperator(String b) {

		this.secondOperator = b;
	}
	
	public Operation getOperation() {
		return operation;
	}
	
	public void setOperation(Operation operation) {

		this.operation = operation;
	}
	
	public String getResult() {
		return result;
	}
	
	public void setResult(String result) {
		this.result = result;
	}
	
	private String getStringValue(int number) {

		return String.valueOf(number);
	}
	
	@Override
	public String toString() {
		
		StringBuilder operationText = new StringBuilder();

		if (result != null) {
			
			return result;
		}
		if (firstOperator != null) {
			
			operationText.append(firstOperator);
			
			if (operation != null) {
			
				operationText.append(operation.getSymbol());
			}
			
			if (secondOperator != null) {

				operationText.append(secondOperator);
			}
		} 
		return operationText.toString();
	}

	public int getIntFirstOperator() {
		return Integer.valueOf(firstOperator);
	}

	public int getIntSecondOperator() {
		return Integer.valueOf(secondOperator);
	}

}
